package com.zyh.kaoshi;

import java.util.Scanner;

/*
    统计字符串中大小写字符，数字的出现次数
    测试字符串：zyhNBSTc123hhh
 */
public class Test7 {
    public static void main(String[] args) {
        System.out.println("请输入字符串：");
        String input = new Scanner(System.in).nextLine();
        int big=0,small=0,num=0;
        for (int i = 0; i < input.length(); i++) {
            char c = input.charAt(i);
            if (c>='A'&&c<='Z'){
                big++;
            }
            else if (c>='a'&&c<='z'){
                small++;
            }
            else if (c>='0'&&c<='9'){
                num++;
            }
        }
        System.out.println("大写字符有："+big);
        System.out.println("小写字符有："+small);
        System.out.println("数字字符有："+num);
    }
}
